<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="js/jquery-1.11.3.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css/bootstrap.css" />
    <link rel="stylesheet" href="css/register.css" />
    <link rel="stylesheet" href="font/iconfont.css" />
  </head>

  <body>
    <!-- 头部 -->
    <header>
      <a
        href="login.html"
        style="font-size:0.55rem; color: #deb05b;margin-left: 0.2rem;"
        ><span class="iconfont iconfanhui1"></span
      ></a>
      <a class="oA" href="#" style="font-size:0.35rem;color: #deb05b"
        >手机号注册</a
      >
      <a href="#" style="font-size:0.55rem;line-height: 0.55rem"></a>
    </header>

    <!-- 内容区域 -->
    <section>
      <article class="tishi">
        <img style="width: 100%" src="img/注册.png" alt="" />
      </article>
      <article style="margin-top: 0.5rem;">
        <div class="oDiv">
          <label style="color: #626262;" for=""
            >+86:<span class="glyphicon glyphicon-triangle-bottom"
              >&nbsp;</span
            ></label
          >
          <input
            class="ipt1 ipt4"
            type="text"
            placeholder="国外手机请选择区号"
          />
          <div class="visibi"></div>
        </div>
        <div class="oDiv">
          <label style="color: #626262;" for=""
            >密码：&nbsp;&nbsp;&nbsp;&nbsp;</label
          >
          <input class="ipt1 ipt3" type="password" placeholder="请输入密码" />
          <div class="visibi"></div>
        </div>
        <div class="oDiv" style="margin-top: 0.5rem;">
          <div class="YZM">
            <label style="color: #626262;margin-top: 0.1rem;" for=""
              >验证码：&nbsp;&nbsp;</label
            >
            <div class="inputs">
              <input class="ipt2" type="text" placeholder="请输入验证码" />
              <input class="btn" type="button" value="获取短信验证码" />
            </div>
          </div>
          <div class="visibi"></div>
        </div>
        <p>点击“注册”按钮，证明你已经阅读或同意<span>用户注册协议</span></p>
        <button class="bTns">注册</button>
      </article>
    </section>
    <script src="js/axios.min.js"></script>
    <script src="js/api.js"></script>
    <script src="js/RegExp.js"></script>
    <script>
      let oIpt = document.querySelectorAll('article input');
      console.log(oIpt);
      let regBtn = document.querySelector('.bTns');
      regBtn.onclick = function() {
        console.log(111);
        if (oIpt[0].value || oIpt[1].value != '') {
          axios
            .post(regeditApi, {
              password: oIpt[1].value,
              loginCount: oIpt[0].value,
            })
            .then(res => {
              console.log(res);
              alert('注册成功');
              location.href = 'login.html';
            });
        } else {
          alert('输入不能为空');
        }
        oIpt[0].value = '';
        oIpt[1].value = '';
      };
    </script>
  </body>
</html>
